from method import Method, Param, KeywordParam, String, Boolean, Integer

class GetPortfolio(Method):
    """
    Arguments:
    String ProductType (optional) -- CommonPrint, DigitalPrint, SpecialityPrint,
      Merchandise, Download
    Integer ProductID (optional)
    
    >>> smugmug.propricing.getPortfolio()
    Traceback (most recent call last):
    InvalidAlbum: invalid data (no custom portfolio pricing set)
    """

    name = 'smugmug.propricing.getPortfolio'
    keywordParams = (
        KeywordParam('ProductType', String),
        KeywordParam('ProductID', Integer)
    )

getPortfolio = GetPortfolio()

class GetAlbum(Method):
    """
    Arguments:
    Integer AlbumID
    String ProductType (optional) -- CommonPrint, DigitalPrint, SpecialityPrint,
      Merchandise, Download
    Integer ProductID (optional)
    
    >>> smugmug.propricing.getAlbum(-1)
    Traceback (most recent call last):
    InvalidAlbum: invalid album
    
    >>> albums = smugmug.albums.get()
    >>> smugmug.propricing.getAlbum(albums[0]['id'])
    Traceback (most recent call last):
    InvalidAlbum: invalid data (no custom album pricing set)
    """

    name = 'smugmug.propricing.getAlbum'
    params = (
        Param('AlbumID', Integer),
    )
    keywordParams = (
        KeywordParam('ProductType', String),
        KeywordParam('ProductID', Integer)
    )

getAlbum = GetAlbum()

class GetImage(Method):
    """
    Arguments:
    Integer ImageID
    String ProductType (optional) -- CommonPrint, DigitalPrint, SpecialityPrint,
      Merchandise, Download
    Integer ProductID (optional)


    >>> smugmug.propricing.getImage(-1) # This incorrectly returns an error for InvalidAlbum 
    Traceback (most recent call last):
    InvalidAlbum: invalid album
       
    >>> albums = smugmug.albums.get()
    >>> images = smugmug.images.get(AlbumID=albums[0]['id'])
    >>> smugmug.propricing.getImage(images[0]['id'])
    Traceback (most recent call last):
    InvalidAlbum: invalid data (no custom image pricing set)
    """

    name = 'smugmug.propricing.getImage'
    params = (
        Param('ImageID', Integer),
    )
    keywordParams = (
        KeywordParam('ProductType', String),
        KeywordParam('ProductID', Integer)
    )

getImage = GetImage()
